//
//  MPTopViewCell.m
//  MobileProject
//
//  Created by caiqilin on 2017/6/14.
//  Copyright © 2017年 caiqilin. All rights reserved.
//

#import "MPTopViewCell.h"

@implementation MPTopViewCell

+ (instancetype)cellWithTableView:(UITableView *)tableView {
    static NSString *ID = @"MPTopViewCell";
    MPTopViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    
    if (cell == nil) {
        
        cell = [[[NSBundle mainBundle] loadNibNamed:@"MPTopViewCell" owner:nil options:nil] lastObject];
    }
    
    return cell;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    
    UITapGestureRecognizer *leftTap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(leftBtnClick)];
    [_leftView addGestureRecognizer:leftTap];
    
    UITapGestureRecognizer *rightTap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(rightBtnClick)];
    [_rightView addGestureRecognizer:rightTap];
    

}

- (void)leftBtnClick {
    if ([_delegate respondsToSelector:@selector(topViewCellLeftBtnClick:)]) {
        [_delegate topViewCellLeftBtnClick:self];
    }
}

- (void)rightBtnClick {
    if ([_delegate respondsToSelector:@selector(topViewCellRightBtnClick:)]) {
        [_delegate topViewCellRightBtnClick:self];
    }
}
@end
